import request from '@/utils/request'
import { apiVersion } from '@/settings'

/** 客户接口 */

export function fetchList(data) {
  return request({
    url: apiVersion + '/customer/query',
    method: 'post',
    data
  })
}

// 查询客户联系人
export function fetchContactList(data) {
  return request({
    url: apiVersion + '/customer/contact/query',
    method: 'post',
    data
  })
}

// 添加客户联系人
export function createContact(data) {
  return request({
    url: apiVersion + '/customer/contact/create',
    method: 'post',
    data
  })
}

// 修改客户联系人
export function modifyContact(data) {
  return request({
    url: apiVersion + '/customer/contact/modify',
    method: 'post',
    data
  })
}

// 删除客户联系人
export function deleteContact(data) {
  return request({
    url: apiVersion + '/customer/contact/remove',
    method: 'post',
    data
  })
}

// 客户修改状态接口(管理端)
export function modify(data) {
  return request({
    url: apiVersion + '/customer/modify',
    method: 'post',
    data
  })
}

// 查看客户的藏品
export function listWorksPage(data) {
  return request({
    url: apiVersion + '/customer/product/listWorksPage',
    method: 'post',
    data
  })
}

// 查询我得藏品详细
export function listProductPage(data) {
  return request({
    url: apiVersion + '/customer/product/listProductPage',
    method: 'post',
    data
  })
}

// 修改藏品锁定状态
export function updateLockFlag(data) {
  return request({
    url: apiVersion + '/customer/product/updateLockFlag',
    method: 'post',
    data
  })
}

// 导出客户接口
export function exportCustomer(data) {
  return request({
    url: apiVersion + '/customer/export',
    method: 'post',
    data
  })
}

// 客户查询提现记录接口(管理端)
export function listCashPage(data) {
  return request({
    url: apiVersion + '/customer/cash/record/query',
    method: 'post',
    data
  })
}

// 查询全部公司
export function queryCompany(data) {
  return request({
    url: apiVersion + '/company/all/query',
    method: 'post',
    data
  })
}


// 添加客户
export function createCustomer(data) {
  return request({
    url: apiVersion + '/customer/create',
    method: 'post',
    data
  })
}

// export function getCustomerContact(data) {
//   return request({
//     url: apiVersion + '/customer/contact/view',
//     method: 'post',
//     data
//   })
// }


/** 服务专员 */ 
// /v1/customer/service/officer/view
// 查看服务专员
export function viewServiceOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/view',
    method: 'post',
    data
  })
}
// 查询服务专员
export function queryServiceOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/query',
    method: 'post',
    data
  })
}
// 添加服务专员
export function addServiceOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/create',
    method: 'post',
    data
  })
}
// 修改服务专员
export function modifyServiceOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/modify',
    method: 'post',
    data
  })
}
// 删除服务专员
export function deleteServiceOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/remove',
    method: 'post',
    data
  })
}

// 查看客户基本信息
export function viewCustomer(data) {
  return request({
    url: apiVersion + '/customer/view',
    method: 'post',
    data
  })
}

// 修改客户基本信息
export function modifyCustomer(data) {
  return request({
    url: apiVersion + '/customer/modify',
    method: 'post',
    data
  })
}



// 查看财务结算
export function viewCustomerFinancial(data) {
  return request({
    url: apiVersion + '/customer/financial/settlement/view',
    method: 'post',
    data
  })
}

// 修改财务结算
export function modifyCustomerFinancial(data) {
  return request({
    url: apiVersion + '/customer/financial/settlement/modify',
    method: 'post',
    data
  })
}


// 添加乘客
export function createCustomerPassenger(data) {
  return request({
    url: apiVersion + '/customer/passenger/create',
    method: 'post',
    data
  })
}

// 查询乘客
export function queryCustomerPassenger(data) {
  return request({
    url: apiVersion + '/customer/passenger/query',
    method: 'post',
    data
  })
}

// 修改乘客
export function modifyCustomerPassenger(data) {
  return request({
    url: apiVersion + '/customer/passenger/modify',
    method: 'post',
    data
  })
}

// 查看乘客
export function viewCustomerPassenger(data) {
  return request({
    url: apiVersion + '/customer/passenger/view',
    method: 'post',
    data
  })
}

// 删除乘客
export function removeCustomerPassenger(data) {
  return request({
    url: apiVersion + '/customer/passenger/remove',
    method: 'post',
    data
  })
}

// 添加服务专员
export function createCustomerOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/create',
    method: 'post',
    data
  })
}

// 查询服务专员
export function queryCustomerOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/query',
    method: 'post',
    data
  })
}

// 修改服务专员
export function modifyCustomerOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/modify',
    method: 'post',
    data
  })
}

// 查看服务专员
export function viewCustomerOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/view',
    method: 'post',
    data
  })
}

// 删除服务专员
export function removeCustomerOfficer(data) {
  return request({
    url: apiVersion + '/customer/service/officer/remove',
    method: 'post',
    data
  })
}



// 添加客户账号
export function createCustomerAccount(data) {
  return request({
    url: apiVersion + '/customer/account/create',
    method: 'post',
    data
  })
}

// 查询客户账号
export function queryCustomerAccount(data) {
  return request({
    url: apiVersion + '/customer/account/query',
    method: 'post',
    data
  })
}

// 修改客户账号
export function modifyCustomerAccount(data) {
  return request({
    url: apiVersion + '/customer/account/modify',
    method: 'post',
    data
  })
}

// 修改客户账号密码
export function modifyCustomerAccountPassword(data) {
  return request({
    url: apiVersion + '/customer/account/password/modify',
    method: 'post',
    data
  })
}

// 修改客户账号状态
export function modifyCustomerAccountStatus(data) {
  return request({
    url: apiVersion + '/customer/account/status/modify',
    method: 'post',
    data
  })
}


// 查询客户飞行记录
export function queryCustomerFlightRecord(data) {
  return request({
    url: apiVersion + '/customer/flight/record/query',
    method: 'post',
    data
  })
}


